/*
 * Copyright 2008 Stuart Moffatt stuartmoffatt@gmail.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.googlecode.emcode.rvha.client.ui;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.StackPanel;

public class RemoteControl extends Composite {

	private StackPanel stackPanel;
	private NaturalHazards naturalHazards;
	private TechnologicalHazards technologicalHazards;
	private Vulnerabilities vulnerabilities;
	
	public RemoteControl()
	{
		
		stackPanel = new StackPanel();
		
		naturalHazards = new NaturalHazards();
		naturalHazards.setStyleName("rvha-StackContent");
		
		technologicalHazards = new TechnologicalHazards();
		technologicalHazards.setStyleName("rvha-StackContent");
		
		vulnerabilities = Vulnerabilities.get();
		vulnerabilities.setStyleName("rvha-StackContent");
		
		stackPanel.add(naturalHazards, stackHeader("Natural Hazards"), true);
		stackPanel.add(technologicalHazards, stackHeader("Technological Hazards"), true);
		stackPanel.add(vulnerabilities, stackHeader("Vulnerabilities"), true );
		
		initWidget(stackPanel);
		
		// stackPanel.setHeight("100%");
		
		//stackPanel.setAnimationEnabled(true);
	}
	
	public String stackHeader(String caption)
	{
	    String captionHTML = "<table class='caption' cellpadding='0' cellspacing='0'>"
	        + "<tr>" +
            // "<td class='lcaption'>"
	        // + imageProto.getHTML()
	        // + "</td>" +
            "<td class='lcaption'><b style='white-space:nowrap'>"
	        + caption
	        + "</b></td></tr></table>";
	    return captionHTML;
	}
}
